#ifndef MSGBOX_H
#define MSGBOX_H

#include <QWidget>
#include <QDialog>
#include <QPaintEvent>
#include <QPainter>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QGraphicsBlurEffect>
#include "project.h"

namespace Ui {
class MsgBox;
}

class MsgBox : public QDialog
{
    Q_OBJECT

public:
    explicit MsgBox(QWidget *parent = nullptr);
    ~MsgBox();
    QHBoxLayout* getButtonLayout();
    void setTitle(const QString &title);
    void setBtnCancelVisible(bool state);
    void setBtnOkVisible(bool state);
    void setMenuVisible(bool state);
    QString text();
    void setText(const QString & text);
    void setTextStyleSheet(const QString & styleSheet);
    QString informativeText();
    void setInformativeText(const QString &text);
    QString getBtnCancelStyleSheet();
    QString getBtnOkStyleSheet();
    void hideInformation();
    int inform(QWidget *parent, const QString &title,
                    const QString &text);
    int warn(QWidget *parent, const QString &title,
                const QString &text);

    static QMessageBox::StandardButton information(QWidget *parent, const QString &title,
         const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok,
         QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
    static QMessageBox::StandardButton warning(QWidget *parent, const QString &title,
         const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok,
         QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);

public slots:
    void clickSlot();
    virtual int exec();

private:
    void initWidget();

protected:
    void paintEvent(QPaintEvent *event);

private:
    Ui::MsgBox *ui;
    QString title;
    QMessageBox::StandardButton state;
};

#endif // MSGBOX_H
